home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
apendixb.lha
/
appendixb
/
swap.h
< prev
Wrap
Text File
|
1993-08-08
|
726b
|
45 lines
/ define a swap function for the various basic types
ifndef SWAPH
define SWAPH
verload swap;
define defswap(typex) \
inline void swap(typex &a, typex &b) \
{ \
typex tmp = a; \
a = b; \
b = tmp; \
}
/ all basic types
efswap(char)
efswap(short)
efswap(int)
efswap(long)
ifndef NO_UNSIGNED_OVERLOADING
efswap(unsigned char)
efswap(unsigned short)
efswap(unsigned int)
efswap(unsigned long)
endif /* NO_UNSIGNED_OVERLOADING */
efswap(float)
efswap(double)
/ pointers to each basic type
efswap(char *)
efswap(short *)
efswap(int *)
efswap(long *)
efswap(unsigned char *)
efswap(unsigned short *)
efswap(unsigned int *)
efswap(unsigned long *)
efswap(float *)
efswap(double *)
endif /* SWAPH */